\(\int \frac {\cot (d (a+b \log (c x^n)))}{x} \, dx\) [213]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F(-1)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 25 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\log \left (\sin \left (a d+b d \log \left (c x^n\right )\right )\right )}{b d n} \]

[Out]

ln(sin(a*d+b*d*ln(c*x^n)))/b/d/n

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {3556} \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\log \left (\sin \left (a d+b d \log \left (c x^n\right )\right )\right )}{b d n} \]

[In]

Int[Cot[d*(a + b*Log[c*x^n])]/x,x]

[Out]

Log[Sin[a*d + b*d*Log[c*x^n]]]/(b*d*n)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \cot (d (a+b x)) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = \frac {\log \left (\sin \left (a d+b d \log \left (c x^n\right )\right )\right )}{b d n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 50, normalized size of antiderivative = 2.00 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\log \left (\cos \left (d \left (a+b \log \left (c x^n\right )\right )\right )\right )}{b d n}+\frac {\log \left (\tan \left (a d+b d \log \left (c x^n\right )\right )\right )}{b d n} \]

[In]

Integrate[Cot[d*(a + b*Log[c*x^n])]/x,x]

[Out]

Log[Cos[d*(a + b*Log[c*x^n])]]/(b*d*n) + Log[Tan[a*d + b*d*Log[c*x^n]]]/(b*d*n)

Maple [A] (verified)

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.20

method result size
derivativedivides \(-\frac {\ln \left ({\cot \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}^{2}+1\right )}{2 n b d}\) \(30\)
default \(-\frac {\ln \left ({\cot \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}^{2}+1\right )}{2 n b d}\) \(30\)
parallelrisch \(\frac {\ln \left (\tan \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )\right )+\ln \left (\frac {1}{\sqrt {{\sec \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}^{2}}}\right )}{b d n}\) \(44\)
risch \(i \ln \left (x \right )-\frac {2 i a}{n b}-\frac {2 i \ln \left (c \right )}{n}-\frac {2 i \ln \left (x^{n}\right )}{n}-\frac {\pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{n}+\frac {\pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{n}+\frac {\pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{n}-\frac {\pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{n}+\frac {\ln \left (\left (x^{n}\right )^{2 i b d} c^{2 i b d} {\mathrm e}^{d \left (-b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )+b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )+2 i a \right )}-1\right )}{b d n}\) \(237\)

[In]

int(cot(d*(a+b*ln(c*x^n)))/x,x,method=_RETURNVERBOSE)

[Out]

-1/2/n/b/d*ln(cot(d*(a+b*ln(c*x^n)))^2+1)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.40 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\log \left (-\frac {1}{2} \, \cos \left (2 \, b d n \log \left (x\right ) + 2 \, b d \log \left (c\right ) + 2 \, a d\right ) + \frac {1}{2}\right )}{2 \, b d n} \]

[In]

integrate(cot(d*(a+b*log(c*x^n)))/x,x, algorithm="fricas")

[Out]

1/2*log(-1/2*cos(2*b*d*n*log(x) + 2*b*d*log(c) + 2*a*d) + 1/2)/(b*d*n)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (20) = 40\).

Time = 1.34 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.84 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\begin {cases} \log {\left (x \right )} \cot {\left (a d \right )} & \text {for}\: b = 0 \\\tilde {\infty } \log {\left (x \right )} & \text {for}\: d = 0 \\\log {\left (x \right )} \cot {\left (a d + b d \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\\frac {\log {\left (\sin {\left (a d + b d \log {\left (c x^{n} \right )} \right )} \right )}}{b d n} & \text {otherwise} \end {cases} \]

[In]

integrate(cot(d*(a+b*ln(c*x**n)))/x,x)

[Out]

Piecewise((log(x)*cot(a*d), Eq(b, 0)), (zoo*log(x), Eq(d, 0)), (log(x)*cot(a*d + b*d*log(c)), Eq(n, 0)), (log(
sin(a*d + b*d*log(c*x**n)))/(b*d*n), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.96 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\log \left (\sin \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )\right )}{b d n} \]

[In]

integrate(cot(d*(a+b*log(c*x^n)))/x,x, algorithm="maxima")

[Out]

log(sin((b*log(c*x^n) + a)*d))/(b*d*n)

Giac [F(-1)]

Timed out. \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\text {Timed out} \]

[In]

integrate(cot(d*(a+b*log(c*x^n)))/x,x, algorithm="giac")

[Out]

Timed out

Mupad [B] (verification not implemented)

Time = 29.08 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.48 \[ \int \frac {\cot \left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=-\ln \left (x\right )\,1{}\mathrm {i}+\frac {\ln \left ({\mathrm {e}}^{a\,d\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,d\,2{}\mathrm {i}}-1\right )}{b\,d\,n} \]

[In]

int(cot(d*(a + b*log(c*x^n)))/x,x)

[Out]

log(exp(a*d*2i)*(c*x^n)^(b*d*2i) - 1)/(b*d*n) - log(x)*1i